<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>BFC</title>
    <style>
        .box1{
            width: 200px;
            height: 200px;
            background-color: #bfa;
            display: flow-root;
        }

        .box2{
            width: 100px;
            height: 100px;
            background-color: tomato;
            margin-top: 100px;
        }

        .box3{
            width: 200px;
            height: 200px;
            background-color: skyblue;
            float: left;
        }

        .box4{
            width: 200px;
            height: 200px;
            background-color: greenyellow;
            display: flow-root;
        }

    </style>
</head>
<body>
<!--
    1.开启BFC后，子元素的垂直外边距不会传递给父元素
    2.开启BFC后，元素不会被浮动元素所覆盖
    3.开启BFC后，元素可以包含浮动的子元素
-->
<div class="box1">
    <div class="box2"></div>
</div>

<hr>

<div class="box3"></div>
<div class="box4"></div>
</body>
</html>